package com.iqiyi.controller;

import com.iqiyi.dto.ActionResult;
import com.iqiyi.po.Sort;
import com.iqiyi.service.SortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 分类的控制层
 *
 * @author YoungKai
 * @date 2021/2/24 11:24
 */
@RestController
@RequestMapping("/sort")
public class SortController {

    @Autowired
    private SortService sortService;

    /**
     * 查找所有分类
     * @return
     */
    @RequestMapping(value = "findAllSort",method = RequestMethod.GET)
    public ActionResult findAllSort(){
        List<Sort> sorts = sortService.selectAllSort();
        return new ActionResult(200,"查询成功",sorts);
    }
}
